import { Module } from "vuex";
import { GlobalDataProps } from "../index";
import { dictionaryApi } from "@/api/dictionary"

export interface dictionaryProps {
    ryxx: any[];
}

const dictionary: Module<dictionaryProps, GlobalDataProps> = {
    namespaced: true,
    state: {
        ryxx: [],
    },
    mutations: {
        serviceType(state, data) {
            state.ryxx = data
        }
    },
    actions: {
        async getServiceType({ commit }) {
            const { data } = await dictionaryApi();
            commit('serviceType', data)
        }
    }
};

export default dictionary;
